<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>基于H5的有弹幕的视频功能</title>
    <link rel="stylesheet" href="main.css">
    <script src="jquery-2.1.4.min.js"></script>
    <script src="jquery.danmu.min.js"></script>
    <script src="main.css"></script>

</head>
<body>
<div id="danmup" style="background-color: #00a0e9;margin: 20px auto">

</div>
<script>
    $("#danmup").DanmuPlayer({
        src: "http://vjs.zencdn.net/v/oceans.mp4", //视频源
        height: "480px", //区域的高度
        width: "800px", //区域的宽度
        urlToGetDanmu:"getData.php",  //从后端获取弹幕数据
        urlToPostDanmu:"sendData.php"  //发送弹幕数据给后端保存入库
    });
    $("#danmup .danmu-div").danmu("addDanmu",[
        { "text":"这是滚动弹幕" ,color:"white",size:1,position:0,time:2},
        { "text":"我是帽子绿" ,color:"green",size:1,position:0,time:3},
        { "text":"哈哈哈啊哈" ,color:"#f30",size:1,position:0,time:10},
        { "text":"大家好，我是打不死的小强" ,color:"orange",size:1,position:0,time:23}
    ]);



</script>



</body>

</html>